Skip to content

Hint Mode =: Honor all registered modes, enforce = mode in Hint Extern - #22415

Open
Janno wants to merge 3 commits into
rocq-prover:masterfrom
Janno:janno/hint-mode-i
Open

Hint Mode =: Honor all registered modes, enforce = mode in Hint Extern#22415
Janno wants to merge 3 commits into
rocq-prover:masterfrom
Janno:janno/hint-mode-i

Conversation

@Janno

@Janno Janno commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Generated by an LLM. The fix makes sense to me but so did the original code.. :)

Fixes / closes #22413

  • Added / updated test-suite.
  • Added changelog.
  • Added / updated documentation.
    • Documented any new / changed user messages.
    • Updated documented syntax by running make doc_gram_rsts.
  • Opened overlay pull requests.

@coqbot-app coqbot-app Bot added the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Aug 28, 2026
@Janno

Janno commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

@coqbot run full ci

@coqbot-app coqbot-app Bot removed the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Aug 28, 2026
@Janno
Janno marked this pull request as ready for review August 28, 2026 17:05
@Janno
Janno requested review from a team as code owners August 28, 2026 17:05
Comment thread test-suite/bugs/bug_22413.v Outdated

Global Hint Mode C = : typeclass_instances.

(* Mode [=] gates the extern hint but does not restrict the tactic run by

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a documented (and intended) feature or more of an implementation artifact? The fact that + guards a Hint Extern, but = does not seems inconsistent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is explicitly documented in https://rocq-prover.org/doc/v9.3/refman/proofs/automatic-tactics/auto.html#rocq:cmd.Hint-Mode

We could possibly consider a post-hint check that looks at the state of the = arguments and retroactively fails the hint if any evars got instantiated. I do not remember why I didn't consider this for the first implementation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you propose sounds good. In Iris we often use Hint Extern with notypeclasses refine so that we can use the "new" unification (evarconv). It would be awkward if these "instances" have a different behavior regarding modes. So I think the current (documented) behavior is a bug.

Do you want me to make an issue/bug report to track this problem?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have optimistically rolled the change into this PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Janno
Janno requested a review from a team as a code owner September 1, 2026 11:38
@coqbot-app coqbot-app Bot added the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Sep 1, 2026
@Janno Janno changed the title Honor all registered modes when one mode is = Hint Mode =: Honor all registered modes, enforce = mode in Hint Extern Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mode = does not work as expected with multiple Hint Mode declarations

2 participants